<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-store"/>
    <meta http-equiv="Expires" content="0"/>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/static/favicon2.ico}">
    <link rel="stylesheet" th:href="@{/static/plugins/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/static/css/layout.css}">
    <link rel="stylesheet" th:href="@{/static/css/common.css}">
    <style>
        img {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            overflow: hidden;
        }
    </style>
</head>
<body>

<div class="layui-tab">
    <ul class="layui-tab-title">
        <li th:class="${type eq 1}?layui-this">基本信息</li>
        <li th:class="${type eq 2}?layui-this">健康数据</li>
        <li th:class="${type eq 3}?layui-this">服务记录</li>
    </ul>
    <div class="layui-tab-content">
        <div th:class="${type eq 1}?'layui-tab-item layui-show':'layui-tab-item'">
            <div class="form-content">
                <div class="layui-row">
                    <input type="hidden" name="type" th:value="${type}">
                    <input type="hidden" name="elderlyId" th:value="${elderly.id}">
                    <p>
                        <img th:if="${elderly.avatar !=null && elderly.avatar!=''}"
                             th:src="@{'/storage/files/'+${elderly.avatar}}">
                        <img th:if="${elderly.avatar ==null || elderly.avatar ==''}" src="/static/imgs/elder.png">
                    </p>
                    <p>
                        姓名：<span th:text="${elderly.name}"></span>
                    </p>
                    <p>
                        身份证号：<span th:text="${elderly.idNo}"></span>
                    </p>
                    <p>
                        生日：<span th:text="${#dates.format(elderly.birthday,'yyyy-MM-dd')}"></span>
                    </p>
                    <p>
                        性别：<span th:text="${elderly.sex}"></span>
                    </p>
                    <p>
                        人员类别：
                        <span th:if="${elderly.personCategory eq 0}">老年人</span>
                        <span th:if="${elderly.personCategory eq 1}">残疾人</span>
                        <span th:if="${elderly.personCategory} eq 2">未成年人</span>
                    </p>
                    <p>
                        户籍类别：
                        <span th:if="${elderly.censusRegisterCategory eq 0}">农业</span>
                        <span th:if="${elderly.censusRegisterCategory eq 1}">城市</span>
                    </p>
                    <p>
                        联系电话：<span th:text="${elderly.phone}"></span>
                    </p>
                    <p>
                        民族：<span th:text="${elderly.nation}"></span>
                    </p>
                    <p>
                        健康状况：
                        <span th:if="${elderly.healthCondition eq 1}">自理老人</span>
                        <span th:if="${elderly.healthCondition eq 2}">半失能老人</span>
                        <span th:if="${elderly.healthCondition eq 3}">失能老人</span>
                    </p>
                    <p>
                        是否优抚：
                        <span th:if="${elderly.youfu eq true}">是</span>
                        <span th:if="${elderly.youfu} eq false">否</span>
                    </p>
                    <p>
                        是否空巢：
                        <span th:if="${elderly.emptyNest eq true}">是</span>
                        <span th:if="${elderly.emptyNest} eq false">否</span>
                    </p>
                </div>
            </div>
        </div>
        <div th:class="${type eq 2}?'layui-tab-item layui-show':'layui-tab-item'">
            <div class="layui-card">
                <div class="layui-card-header">健康数据(各数值取自最新体检数据)</div>
                <div class="layui-card-body">
                    <span th:if="${#lists.size(healthDataList) <= 0 }" style="color: #CCCCCC;">暂无健康数据</span>
                    <table class="layui-table" lay-size="sm" th:if="${#lists.size(healthDataList) > 0 }">
                        <thead>
                        <tr>
                            <th width="100px">名称</th>
                            <th>数据</th>
                            <th>状况</th>
                            <th>详情与建议</th>
                            <th>参考数值</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="hd:${healthDataList}">
                            <td th:text="${hd.healthDataitemName}" style="color: orangered;"></td>
                            <td th:text="${hd.value}"></td>
                            <td th:if="${!hd.nature}" th:text="阴性"></td>
                            <td th:if="${hd.nature}" th:text="阳性" style="color: red;font-size: 1.1em;"></td>
                            <td th:text="${hd.description} ?: '无'"></td>
                            <td th:text="${hd.standardValues} ?: '无'"></td>
                        </tr>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
        <div th:class="${type eq 3}?'layui-tab-item layui-show':'layui-tab-item'">
            <table id="demo" lay-filter="test" lay-size="sm"></table>
        </div>
    </div>
</div>


<script th:src="@{/static/plugins/jquery.js}"></script>
<script th:src="@{/static/plugins/layui/layui.js}"></script>
<script th:src="@{/static/js/common.js}"></script>
<script th:src="@{/static/plugins/jquery-migrate-1.2.1.min.js}"></script>
<script th:src="@{/static/js/elder/elderly/message.js}"></script>


</body>

</html>